]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
layout: Make the hot corner optional
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 8 Jun 2017 15:07:56 +0000 (17:07 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 10 Jul 2019 15:29:24 +0000 (17:29 +0200)
Whether people love or hate the hot corner depends in large extents
on hardware sensitivity and habits, which is hard to get right
universally. So bite the bullet and support an option to enable or
disable hot corners ...

https://bugzilla.gnome.org/show_bug.cgi?id=688320

js/ui/layout.js

index 775b5759cc4487b73837febf8595a88ea1300043..8430cb89941d998731d4c18db513130f19b364cf 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const { Clutter, GLib, GObject, Meta, Shell, St } = imports.gi;
+const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
 const Signals = imports.signals;
 
 const Background = imports.ui.background;
@@ -274,6 +274,13 @@ var LayoutManager = GObject.registerClass({
         this._backgroundGroup.lower_bottom();
         this._bgManagers = [];
 
+        this._interfaceSettings = new Gio.Settings({
+            schema_id: 'org.gnome.desktop.interface'
+        });
+
+       this._interfaceSettings.connect('changed::enable-hot-corners',
+                                       this._updateHotCorners.bind(this));
+
         // Need to update struts on new workspaces when they are added
         let workspaceManager = global.workspace_manager;
         workspaceManager.connect('notify::n-workspaces',
@@ -377,6 +384,11 @@ var LayoutManager = GObject.registerClass({
         });
         this.hotCorners = [];
 
+        if (!this._interfaceSettings.get_boolean('enable-hot-corners')) {
+            this.emit('hot-corners-changed');
+            return;
+        }
+
         let size = this.panelBox.height;
 
         // build new hot corners